﻿namespace Vibstudio.NetConfigurator.Model
{
    using System;
    using System.Collections.Generic;

    public class Application
    {
        public string ID { get; set; }

        public ApplicationType Type { get; set; }

        public class EqualityComparer : IEqualityComparer<Application>
        {
            public bool Equals(Application x, Application y)
            {
                return x.ID.ToLower() == y.ID.ToLower();
            }

            public int GetHashCode(Application obj)
            {
                return (obj.ID ?? string.Empty).GetHashCode() +
                       (Enum.GetName(typeof(ApplicationType), obj.Type) ?? string.Empty).GetHashCode();
            }
        }
    }
}
